notebook: Implement rtl flipping for CSS nodes
authorMatthias Clasen <mclasen@redhat.com>
Wed, 20 Jan 2016 02:38:30 +0000 (21:38 -0500)
committerMatthias Clasen <mclasen@redhat.com>
Wed, 20 Jan 2016 02:40:47 +0000 (21:40 -0500)
Use gtk_box_gadget_reverse_children and gtk_css_node_reverse_children
to flip the children of the header_gadget and the tabs_gadget when
appropriate.

Add new CSS node tests to verify that the node order is updated
as expected in all cases.

26 files changed:
gtk/gtknotebook.c
testsuite/css/nodes/Makefile.am
testsuite/css/nodes/notebook.bottom.ltr.nodes [new file with mode: 0644]
testsuite/css/nodes/notebook.bottom.ltr.ui [new file with mode: 0644]
testsuite/css/nodes/notebook.bottom.nodes [deleted file]
testsuite/css/nodes/notebook.bottom.rtl.nodes [new file with mode: 0644]
testsuite/css/nodes/notebook.bottom.rtl.ui [new file with mode: 0644]
testsuite/css/nodes/notebook.bottom.ui [deleted file]
testsuite/css/nodes/notebook.left.ltr.nodes [new file with mode: 0644]
testsuite/css/nodes/notebook.left.ltr.ui [new file with mode: 0644]
testsuite/css/nodes/notebook.left.nodes [deleted file]
testsuite/css/nodes/notebook.left.rtl.nodes [new file with mode: 0644]
testsuite/css/nodes/notebook.left.rtl.ui [new file with mode: 0644]
testsuite/css/nodes/notebook.left.ui [deleted file]
testsuite/css/nodes/notebook.right.ltr.nodes [new file with mode: 0644]
testsuite/css/nodes/notebook.right.ltr.ui [new file with mode: 0644]
testsuite/css/nodes/notebook.right.nodes [deleted file]
testsuite/css/nodes/notebook.right.rtl.nodes [new file with mode: 0644]
testsuite/css/nodes/notebook.right.rtl.ui [new file with mode: 0644]
testsuite/css/nodes/notebook.right.ui [deleted file]
testsuite/css/nodes/notebook.top.ltr.nodes [new file with mode: 0644]
testsuite/css/nodes/notebook.top.ltr.ui [new file with mode: 0644]
testsuite/css/nodes/notebook.top.nodes [deleted file]
testsuite/css/nodes/notebook.top.rtl.nodes [new file with mode: 0644]
testsuite/css/nodes/notebook.top.rtl.ui [new file with mode: 0644]
testsuite/css/nodes/notebook.top.ui [deleted file]

index 8481d45bad55d8b1c007c25b6301a04a013cd5ad..f175815124e9b6a8196658f70034f905d287b23d 100644 (file)
@@ -219,6 +219,7 @@ struct _GtkNotebookPrivate
   guint          show_tabs          : 1;
   guint          scrollable         : 1;
   guint          tab_pos            : 2;
+  guint          tabs_reversed      : 1;
 };
 
 enum {
@@ -1290,6 +1291,11 @@ gtk_notebook_init (GtkNotebook *notebook)
   priv->during_detach = FALSE;
   priv->has_scrolled = FALSE;
 
+  if (gtk_widget_get_direction (GTK_WIDGET (notebook)) == GTK_TEXT_DIR_RTL)
+    priv->tabs_reversed = TRUE;
+  else
+    priv->tabs_reversed = FALSE;
+
   gtk_drag_dest_set (GTK_WIDGET (notebook), 0,
                      notebook_targets, G_N_ELEMENTS (notebook_targets),
                      GDK_ACTION_MOVE);
@@ -1825,49 +1831,17 @@ static void
 update_node_ordering (GtkNotebook *notebook)
 {
   GtkNotebookPrivate *priv = notebook->priv;
-  GtkPositionType tab_pos;
-  gboolean is_rtl;
-  GtkCssNode *node, *header_node, *tabs_node;
+  gboolean reverse_tabs;
 
-  tab_pos = get_effective_tab_pos (notebook);
-  is_rtl = gtk_widget_get_direction (GTK_WIDGET (notebook)) == GTK_TEXT_DIR_RTL;
-  header_node = gtk_css_gadget_get_node (priv->header_gadget);
-  tabs_node = gtk_css_gadget_get_node (priv->tabs_gadget);
+  reverse_tabs = (priv->tab_pos == GTK_POS_TOP || priv->tab_pos == GTK_POS_BOTTOM) &&
+                 gtk_widget_get_direction (GTK_WIDGET (notebook)) == GTK_TEXT_DIR_RTL;
 
-  switch (tab_pos)
+  if ((reverse_tabs && !priv->tabs_reversed) ||
+      (!reverse_tabs && priv->tabs_reversed))
     {
-    case GTK_POS_TOP:
-    case GTK_POS_BOTTOM:
-      if (priv->action_widget[ACTION_WIDGET_START])
-        {
-          node = gtk_widget_get_css_node (priv->action_widget[ACTION_WIDGET_START]);
-          if (is_rtl)
-            gtk_css_node_insert_after (header_node, node, tabs_node);
-          else
-            gtk_css_node_insert_before (header_node, node, tabs_node);
-        }
-      if (priv->action_widget[ACTION_WIDGET_END])
-        {
-          node = gtk_widget_get_css_node (priv->action_widget[ACTION_WIDGET_END]);
-          if (is_rtl)
-            gtk_css_node_insert_before (header_node, node, tabs_node);
-          else
-            gtk_css_node_insert_after (header_node, node, tabs_node);
-        }
-      break;
-    case GTK_POS_LEFT:
-    case GTK_POS_RIGHT:
-      if (priv->action_widget[ACTION_WIDGET_START])
-        {
-          node = gtk_widget_get_css_node (priv->action_widget[ACTION_WIDGET_START]);
-          gtk_css_node_insert_before (header_node, node, tabs_node);
-        }
-      if (priv->action_widget[ACTION_WIDGET_END])
-        {
-          node = gtk_widget_get_css_node (priv->action_widget[ACTION_WIDGET_END]);
-          gtk_css_node_insert_after (header_node, node, tabs_node);
-        }
-      break;
+      gtk_box_gadget_reverse_children (GTK_BOX_GADGET (priv->header_gadget));
+      gtk_css_node_reverse_children (gtk_css_gadget_get_node (priv->tabs_gadget));
+      priv->tabs_reversed = reverse_tabs;
     }
 }
 
@@ -4767,6 +4741,9 @@ gtk_notebook_real_insert_page (GtkNotebook *notebook,
   else
     sibling = priv->arrow_gadget[ARROW_RIGHT_AFTER];
 
+  if (priv->tabs_reversed)
+    gtk_css_node_reverse_children (gtk_css_gadget_get_node (priv->tabs_gadget));
+
   page->gadget = gtk_css_custom_gadget_new ("tab",
                                             GTK_WIDGET (notebook),
                                             priv->tabs_gadget,
@@ -4776,6 +4753,9 @@ gtk_notebook_real_insert_page (GtkNotebook *notebook,
                                             draw_tab,
                                             page,
                                             NULL);
+  if (priv->tabs_reversed)
+    gtk_css_node_reverse_children (gtk_css_gadget_get_node (priv->tabs_gadget));
+
   gtk_css_gadget_set_state (page->gadget, gtk_css_node_get_state (gtk_css_gadget_get_node (priv->tabs_gadget)));
 
   if (!tab_label)
@@ -7050,6 +7030,8 @@ gtk_notebook_update_tab_pos (GtkNotebook *notebook)
       gtk_box_gadget_set_orientation (GTK_BOX_GADGET (priv->header_gadget), GTK_ORIENTATION_VERTICAL);
       break;
     }
+
+  update_node_ordering (notebook);
 }
 
 /**
@@ -8017,14 +7999,19 @@ gtk_notebook_set_action_widget (GtkNotebook *notebook,
 
   if (widget)
     {
+      int pos;
+
       gtk_css_node_set_parent (gtk_widget_get_css_node (widget),
                                gtk_css_gadget_get_node (priv->header_gadget));
-      gtk_box_gadget_insert_widget (GTK_BOX_GADGET (priv->header_gadget),
-                                    pack_type == GTK_PACK_START ? 0 : -1,
-                                    widget);
+
+      if (priv->tabs_reversed)
+        pos = pack_type == GTK_PACK_START ? -1 : 0;
+      else
+        pos = pack_type == GTK_PACK_START ? 0 : -1;
+
+      gtk_box_gadget_insert_widget (GTK_BOX_GADGET (priv->header_gadget), pos, widget);
       gtk_widget_set_child_visible (widget, priv->show_tabs);
       gtk_widget_set_parent (widget, GTK_WIDGET (notebook));
-      update_node_ordering (notebook);
     }
 
   gtk_widget_queue_resize (GTK_WIDGET (notebook));
index c00eaef18be3d2e3a0b0711707792a84f679cde2..10dcc27ae4ee2eba7f001dd3ba0885e636ab6a2c 100644 (file)
@@ -28,23 +28,27 @@ test_css_nodes_SOURCES = \
        $(NULL)
 
 test_data = \
-       box.ltr.ui              box.ltr.nodes           \
-       box.rtl.ui              box.rtl.nodes           \
-       buttons.ui              buttons.nodes           \
-       checkbutton.ltr.ui      checkbutton.ltr.nodes   \
-       checkbutton.rtl.ui      checkbutton.rtl.nodes   \
-       entries.ui              entries.nodes           \
-       expander.ltr.ui         expander.ltr.nodes      \
-       expander.rtl.ui         expander.rtl.nodes      \
-       levelbar.ltr.ui         levelbar.ltr.nodes      \
-       levelbar.rtl.ui         levelbar.rtl.nodes      \
-       notebook.top.ui         notebook.top.nodes      \
-       notebook.left.ui        notebook.left.nodes     \
-       notebook.right.ui       notebook.right.nodes    \
-       notebook.bottom.ui      notebook.bottom.nodes   \
-       paned.ltr.ui            paned.ltr.nodes         \
-       paned.rtl.ui            paned.rtl.nodes         \
-       progressbar.ui          progressbar.nodes       \
+       box.ltr.ui              box.ltr.nodes                   \
+       box.rtl.ui              box.rtl.nodes                   \
+       buttons.ui              buttons.nodes                   \
+       checkbutton.ltr.ui      checkbutton.ltr.nodes           \
+       checkbutton.rtl.ui      checkbutton.rtl.nodes           \
+       entries.ui              entries.nodes                   \
+       expander.ltr.ui         expander.ltr.nodes              \
+       expander.rtl.ui         expander.rtl.nodes              \
+       levelbar.ltr.ui         levelbar.ltr.nodes              \
+       levelbar.rtl.ui         levelbar.rtl.nodes              \
+       notebook.top.ltr.ui     notebook.top.ltr.nodes          \
+       notebook.top.rtl.ui     notebook.top.rtl.nodes          \
+       notebook.left.ltr.ui    notebook.left.ltr.nodes         \
+       notebook.left.rtl.ui    notebook.left.rtl.nodes         \
+       notebook.right.ltr.ui   notebook.right.ltr.nodes        \
+       notebook.right.rtl.ui   notebook.right.rtl.nodes        \
+       notebook.bottom.ltr.ui  notebook.bottom.ltr.nodes       \
+       notebook.bottom.rtl.ui  notebook.bottom.rtl.nodes       \
+       paned.ltr.ui            paned.ltr.nodes                 \
+       paned.rtl.ui            paned.rtl.nodes                 \
+       progressbar.ui          progressbar.nodes               \
        $(NULL)
 
 EXTRA_DIST += $(test_in_files) $(test_data)
diff --git a/testsuite/css/nodes/notebook.bottom.ltr.nodes b/testsuite/css/nodes/notebook.bottom.ltr.nodes
new file mode 100644 (file)
index 0000000..0177d13
--- /dev/null
@@ -0,0 +1,18 @@
+[window.background:dir(ltr)]
+  decoration:dir(ltr)
+  notebook.frame:dir(ltr)
+    stack:dir(ltr)
+      button#page1.text-button:dir(ltr)
+        label:dir(ltr)
+      button#page2.text-button:dir(ltr)
+        label:dir(ltr)
+    header.bottom:dir(ltr)
+      button#start.text-button:dir(ltr)
+        label:dir(ltr)
+      tabs:dir(ltr)
+        tab:active:dir(ltr)
+          label#tab1:dir(ltr)
+        tab:dir(ltr)
+          label#tab2:dir(ltr)
+      button#end.text-button:dir(ltr)
+        label:dir(ltr)
diff --git a/testsuite/css/nodes/notebook.bottom.ltr.ui b/testsuite/css/nodes/notebook.bottom.ltr.ui
new file mode 100644 (file)
index 0000000..176d2b8
--- /dev/null
@@ -0,0 +1,56 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<interface>
+  <!-- interface-requires gtk+ 3.0 -->
+  <object class="GtkWindow" id="window1">
+    <property name="can_focus">False</property>
+    <property name="type">popup</property>
+    <child>
+      <object class="GtkNotebook">
+        <property name="visible">True</property>
+        <property name="tab-pos">bottom</property>
+        <child>
+          <object class="GtkButton">
+            <property name="name">page1</property>
+            <property name="label" translatable="yes">Yes</property>
+            <property name="visible">True</property>
+          </object>
+        </child>
+        <child type="tab">
+          <object class="GtkLabel">
+            <property name="name">tab1</property>
+            <property name="label" translatable="yes">Tab 1</property>
+            <property name="visible">True</property>
+          </object>
+        </child>
+        <child>
+          <object class="GtkButton">
+            <property name="name">page2</property>
+            <property name="label" translatable="yes">No</property>
+            <property name="visible">True</property>
+          </object>
+        </child>
+        <child type="tab">
+          <object class="GtkLabel" id="tab2">
+            <property name="name">tab2</property>
+            <property name="label" translatable="yes">Tab 2</property>
+            <property name="visible">True</property>
+          </object>
+        </child>
+        <child type="action-start">
+          <object class="GtkButton">
+            <property name="name">start</property>
+            <property name="label" translatable="yes">Action</property>
+            <property name="visible">True</property>
+          </object>
+        </child>
+        <child type="action-end">
+          <object class="GtkButton">
+            <property name="name">end</property>
+            <property name="label" translatable="yes">Action</property>
+            <property name="visible">True</property>
+          </object>
+        </child>
+      </object>
+    </child>
+  </object>
+</interface>
diff --git a/testsuite/css/nodes/notebook.bottom.nodes b/testsuite/css/nodes/notebook.bottom.nodes
deleted file mode 100644 (file)
index 0177d13..0000000
+++ /dev/null
@@ -1,18 +0,0 @@
-[window.background:dir(ltr)]
-  decoration:dir(ltr)
-  notebook.frame:dir(ltr)
-    stack:dir(ltr)
-      button#page1.text-button:dir(ltr)
-        label:dir(ltr)
-      button#page2.text-button:dir(ltr)
-        label:dir(ltr)
-    header.bottom:dir(ltr)
-      button#start.text-button:dir(ltr)
-        label:dir(ltr)
-      tabs:dir(ltr)
-        tab:active:dir(ltr)
-          label#tab1:dir(ltr)
-        tab:dir(ltr)
-          label#tab2:dir(ltr)
-      button#end.text-button:dir(ltr)
-        label:dir(ltr)
diff --git a/testsuite/css/nodes/notebook.bottom.rtl.nodes b/testsuite/css/nodes/notebook.bottom.rtl.nodes
new file mode 100644 (file)
index 0000000..fdf8204
--- /dev/null
@@ -0,0 +1,18 @@
+[window.background:dir(rtl)]
+  decoration:dir(ltr)
+  notebook.frame:dir(rtl)
+    stack:dir(ltr)
+      button#page1.text-button:dir(rtl)
+        label:dir(ltr)
+      button#page2.text-button:dir(rtl)
+        label:dir(ltr)
+    header.bottom:dir(ltr)
+      button#end.text-button:dir(rtl)
+        label:dir(ltr)
+      tabs:dir(ltr)
+        tab:dir(ltr)
+          label#tab2:dir(ltr)
+        tab:active:dir(ltr)
+          label#tab1:dir(ltr)
+      button#start.text-button:dir(rtl)
+        label:dir(ltr)
diff --git a/testsuite/css/nodes/notebook.bottom.rtl.ui b/testsuite/css/nodes/notebook.bottom.rtl.ui
new file mode 100644 (file)
index 0000000..176d2b8
--- /dev/null
@@ -0,0 +1,56 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<interface>
+  <!-- interface-requires gtk+ 3.0 -->
+  <object class="GtkWindow" id="window1">
+    <property name="can_focus">False</property>
+    <property name="type">popup</property>
+    <child>
+      <object class="GtkNotebook">
+        <property name="visible">True</property>
+        <property name="tab-pos">bottom</property>
+        <child>
+          <object class="GtkButton">
+            <property name="name">page1</property>
+            <property name="label" translatable="yes">Yes</property>
+            <property name="visible">True</property>
+          </object>
+        </child>
+        <child type="tab">
+          <object class="GtkLabel">
+            <property name="name">tab1</property>
+            <property name="label" translatable="yes">Tab 1</property>
+            <property name="visible">True</property>
+          </object>
+        </child>
+        <child>
+          <object class="GtkButton">
+            <property name="name">page2</property>
+            <property name="label" translatable="yes">No</property>
+            <property name="visible">True</property>
+          </object>
+        </child>
+        <child type="tab">
+          <object class="GtkLabel" id="tab2">
+            <property name="name">tab2</property>
+            <property name="label" translatable="yes">Tab 2</property>
+            <property name="visible">True</property>
+          </object>
+        </child>
+        <child type="action-start">
+          <object class="GtkButton">
+            <property name="name">start</property>
+            <property name="label" translatable="yes">Action</property>
+            <property name="visible">True</property>
+          </object>
+        </child>
+        <child type="action-end">
+          <object class="GtkButton">
+            <property name="name">end</property>
+            <property name="label" translatable="yes">Action</property>
+            <property name="visible">True</property>
+          </object>
+        </child>
+      </object>
+    </child>
+  </object>
+</interface>
diff --git a/testsuite/css/nodes/notebook.bottom.ui b/testsuite/css/nodes/notebook.bottom.ui
deleted file mode 100644 (file)
index 176d2b8..0000000
+++ /dev/null
@@ -1,56 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<interface>
-  <!-- interface-requires gtk+ 3.0 -->
-  <object class="GtkWindow" id="window1">
-    <property name="can_focus">False</property>
-    <property name="type">popup</property>
-    <child>
-      <object class="GtkNotebook">
-        <property name="visible">True</property>
-        <property name="tab-pos">bottom</property>
-        <child>
-          <object class="GtkButton">
-            <property name="name">page1</property>
-            <property name="label" translatable="yes">Yes</property>
-            <property name="visible">True</property>
-          </object>
-        </child>
-        <child type="tab">
-          <object class="GtkLabel">
-            <property name="name">tab1</property>
-            <property name="label" translatable="yes">Tab 1</property>
-            <property name="visible">True</property>
-          </object>
-        </child>
-        <child>
-          <object class="GtkButton">
-            <property name="name">page2</property>
-            <property name="label" translatable="yes">No</property>
-            <property name="visible">True</property>
-          </object>
-        </child>
-        <child type="tab">
-          <object class="GtkLabel" id="tab2">
-            <property name="name">tab2</property>
-            <property name="label" translatable="yes">Tab 2</property>
-            <property name="visible">True</property>
-          </object>
-        </child>
-        <child type="action-start">
-          <object class="GtkButton">
-            <property name="name">start</property>
-            <property name="label" translatable="yes">Action</property>
-            <property name="visible">True</property>
-          </object>
-        </child>
-        <child type="action-end">
-          <object class="GtkButton">
-            <property name="name">end</property>
-            <property name="label" translatable="yes">Action</property>
-            <property name="visible">True</property>
-          </object>
-        </child>
-      </object>
-    </child>
-  </object>
-</interface>
diff --git a/testsuite/css/nodes/notebook.left.ltr.nodes b/testsuite/css/nodes/notebook.left.ltr.nodes
new file mode 100644 (file)
index 0000000..ad04ef9
--- /dev/null
@@ -0,0 +1,18 @@
+[window.background:dir(ltr)]
+  decoration:dir(ltr)
+  notebook.frame:dir(ltr)
+    header.left:dir(ltr)
+      button#start.text-button:dir(ltr)
+        label:dir(ltr)
+      tabs:dir(ltr)
+        tab:active:dir(ltr)
+          label#tab1:dir(ltr)
+        tab:dir(ltr)
+          label#tab2:dir(ltr)
+      button#end.text-button:dir(ltr)
+        label:dir(ltr)
+    stack:dir(ltr)
+      button#page1.text-button:dir(ltr)
+        label:dir(ltr)
+      button#page2.text-button:dir(ltr)
+        label:dir(ltr)
diff --git a/testsuite/css/nodes/notebook.left.ltr.ui b/testsuite/css/nodes/notebook.left.ltr.ui
new file mode 100644 (file)
index 0000000..6c2d820
--- /dev/null
@@ -0,0 +1,56 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<interface>
+  <!-- interface-requires gtk+ 3.0 -->
+  <object class="GtkWindow" id="window1">
+    <property name="can_focus">False</property>
+    <property name="type">popup</property>
+    <child>
+      <object class="GtkNotebook">
+        <property name="visible">True</property>
+        <property name="tab-pos">left</property>
+        <child>
+          <object class="GtkButton">
+            <property name="name">page1</property>
+            <property name="label" translatable="yes">Yes</property>
+            <property name="visible">True</property>
+          </object>
+        </child>
+        <child type="tab">
+          <object class="GtkLabel">
+            <property name="name">tab1</property>
+            <property name="label" translatable="yes">Tab 1</property>
+            <property name="visible">True</property>
+          </object>
+        </child>
+        <child>
+          <object class="GtkButton">
+            <property name="name">page2</property>
+            <property name="label" translatable="yes">No</property>
+            <property name="visible">True</property>
+          </object>
+        </child>
+        <child type="tab">
+          <object class="GtkLabel" id="tab2">
+            <property name="name">tab2</property>
+            <property name="label" translatable="yes">Tab 2</property>
+            <property name="visible">True</property>
+          </object>
+        </child>
+        <child type="action-start">
+          <object class="GtkButton">
+            <property name="name">start</property>
+            <property name="label" translatable="yes">Action</property>
+            <property name="visible">True</property>
+          </object>
+        </child>
+        <child type="action-end">
+          <object class="GtkButton">
+            <property name="name">end</property>
+            <property name="label" translatable="yes">Action</property>
+            <property name="visible">True</property>
+          </object>
+        </child>
+      </object>
+    </child>
+  </object>
+</interface>
diff --git a/testsuite/css/nodes/notebook.left.nodes b/testsuite/css/nodes/notebook.left.nodes
deleted file mode 100644 (file)
index ad04ef9..0000000
+++ /dev/null
@@ -1,18 +0,0 @@
-[window.background:dir(ltr)]
-  decoration:dir(ltr)
-  notebook.frame:dir(ltr)
-    header.left:dir(ltr)
-      button#start.text-button:dir(ltr)
-        label:dir(ltr)
-      tabs:dir(ltr)
-        tab:active:dir(ltr)
-          label#tab1:dir(ltr)
-        tab:dir(ltr)
-          label#tab2:dir(ltr)
-      button#end.text-button:dir(ltr)
-        label:dir(ltr)
-    stack:dir(ltr)
-      button#page1.text-button:dir(ltr)
-        label:dir(ltr)
-      button#page2.text-button:dir(ltr)
-        label:dir(ltr)
diff --git a/testsuite/css/nodes/notebook.left.rtl.nodes b/testsuite/css/nodes/notebook.left.rtl.nodes
new file mode 100644 (file)
index 0000000..b1d4e2f
--- /dev/null
@@ -0,0 +1,18 @@
+[window.background:dir(rtl)]
+  decoration:dir(ltr)
+  notebook.frame:dir(rtl)
+    stack:dir(ltr)
+      button#page1.text-button:dir(rtl)
+        label:dir(ltr)
+      button#page2.text-button:dir(rtl)
+        label:dir(ltr)
+    header.right:dir(ltr)
+      button#start.text-button:dir(rtl)
+        label:dir(ltr)
+      tabs:dir(ltr)
+        tab:active:dir(ltr)
+          label#tab1:dir(ltr)
+        tab:dir(ltr)
+          label#tab2:dir(ltr)
+      button#end.text-button:dir(rtl)
+        label:dir(ltr)
diff --git a/testsuite/css/nodes/notebook.left.rtl.ui b/testsuite/css/nodes/notebook.left.rtl.ui
new file mode 100644 (file)
index 0000000..6c2d820
--- /dev/null
@@ -0,0 +1,56 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<interface>
+  <!-- interface-requires gtk+ 3.0 -->
+  <object class="GtkWindow" id="window1">
+    <property name="can_focus">False</property>
+    <property name="type">popup</property>
+    <child>
+      <object class="GtkNotebook">
+        <property name="visible">True</property>
+        <property name="tab-pos">left</property>
+        <child>
+          <object class="GtkButton">
+            <property name="name">page1</property>
+            <property name="label" translatable="yes">Yes</property>
+            <property name="visible">True</property>
+          </object>
+        </child>
+        <child type="tab">
+          <object class="GtkLabel">
+            <property name="name">tab1</property>
+            <property name="label" translatable="yes">Tab 1</property>
+            <property name="visible">True</property>
+          </object>
+        </child>
+        <child>
+          <object class="GtkButton">
+            <property name="name">page2</property>
+            <property name="label" translatable="yes">No</property>
+            <property name="visible">True</property>
+          </object>
+        </child>
+        <child type="tab">
+          <object class="GtkLabel" id="tab2">
+            <property name="name">tab2</property>
+            <property name="label" translatable="yes">Tab 2</property>
+            <property name="visible">True</property>
+          </object>
+        </child>
+        <child type="action-start">
+          <object class="GtkButton">
+            <property name="name">start</property>
+            <property name="label" translatable="yes">Action</property>
+            <property name="visible">True</property>
+          </object>
+        </child>
+        <child type="action-end">
+          <object class="GtkButton">
+            <property name="name">end</property>
+            <property name="label" translatable="yes">Action</property>
+            <property name="visible">True</property>
+          </object>
+        </child>
+      </object>
+    </child>
+  </object>
+</interface>
diff --git a/testsuite/css/nodes/notebook.left.ui b/testsuite/css/nodes/notebook.left.ui
deleted file mode 100644 (file)
index 6c2d820..0000000
+++ /dev/null
@@ -1,56 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<interface>
-  <!-- interface-requires gtk+ 3.0 -->
-  <object class="GtkWindow" id="window1">
-    <property name="can_focus">False</property>
-    <property name="type">popup</property>
-    <child>
-      <object class="GtkNotebook">
-        <property name="visible">True</property>
-        <property name="tab-pos">left</property>
-        <child>
-          <object class="GtkButton">
-            <property name="name">page1</property>
-            <property name="label" translatable="yes">Yes</property>
-            <property name="visible">True</property>
-          </object>
-        </child>
-        <child type="tab">
-          <object class="GtkLabel">
-            <property name="name">tab1</property>
-            <property name="label" translatable="yes">Tab 1</property>
-            <property name="visible">True</property>
-          </object>
-        </child>
-        <child>
-          <object class="GtkButton">
-            <property name="name">page2</property>
-            <property name="label" translatable="yes">No</property>
-            <property name="visible">True</property>
-          </object>
-        </child>
-        <child type="tab">
-          <object class="GtkLabel" id="tab2">
-            <property name="name">tab2</property>
-            <property name="label" translatable="yes">Tab 2</property>
-            <property name="visible">True</property>
-          </object>
-        </child>
-        <child type="action-start">
-          <object class="GtkButton">
-            <property name="name">start</property>
-            <property name="label" translatable="yes">Action</property>
-            <property name="visible">True</property>
-          </object>
-        </child>
-        <child type="action-end">
-          <object class="GtkButton">
-            <property name="name">end</property>
-            <property name="label" translatable="yes">Action</property>
-            <property name="visible">True</property>
-          </object>
-        </child>
-      </object>
-    </child>
-  </object>
-</interface>
diff --git a/testsuite/css/nodes/notebook.right.ltr.nodes b/testsuite/css/nodes/notebook.right.ltr.nodes
new file mode 100644 (file)
index 0000000..500331c
--- /dev/null
@@ -0,0 +1,18 @@
+[window.background:dir(ltr)]
+  decoration:dir(ltr)
+  notebook.frame:dir(ltr)
+    stack:dir(ltr)
+      button#page1.text-button:dir(ltr)
+        label:dir(ltr)
+      button#page2.text-button:dir(ltr)
+        label:dir(ltr)
+    header.right:dir(ltr)
+      button#start.text-button:dir(ltr)
+        label:dir(ltr)
+      tabs:dir(ltr)
+        tab:active:dir(ltr)
+          label#tab1:dir(ltr)
+        tab:dir(ltr)
+          label#tab2:dir(ltr)
+      button#end.text-button:dir(ltr)
+        label:dir(ltr)
diff --git a/testsuite/css/nodes/notebook.right.ltr.ui b/testsuite/css/nodes/notebook.right.ltr.ui
new file mode 100644 (file)
index 0000000..7bea7d9
--- /dev/null
@@ -0,0 +1,56 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<interface>
+  <!-- interface-requires gtk+ 3.0 -->
+  <object class="GtkWindow" id="window1">
+    <property name="can_focus">False</property>
+    <property name="type">popup</property>
+    <child>
+      <object class="GtkNotebook">
+        <property name="visible">True</property>
+        <property name="tab-pos">right</property>
+        <child>
+          <object class="GtkButton">
+            <property name="name">page1</property>
+            <property name="label" translatable="yes">Yes</property>
+            <property name="visible">True</property>
+          </object>
+        </child>
+        <child type="tab">
+          <object class="GtkLabel">
+            <property name="name">tab1</property>
+            <property name="label" translatable="yes">Tab 1</property>
+            <property name="visible">True</property>
+          </object>
+        </child>
+        <child>
+          <object class="GtkButton">
+            <property name="name">page2</property>
+            <property name="label" translatable="yes">No</property>
+            <property name="visible">True</property>
+          </object>
+        </child>
+        <child type="tab">
+          <object class="GtkLabel" id="tab2">
+            <property name="name">tab2</property>
+            <property name="label" translatable="yes">Tab 2</property>
+            <property name="visible">True</property>
+          </object>
+        </child>
+        <child type="action-start">
+          <object class="GtkButton">
+            <property name="name">start</property>
+            <property name="label" translatable="yes">Action</property>
+            <property name="visible">True</property>
+          </object>
+        </child>
+        <child type="action-end">
+          <object class="GtkButton">
+            <property name="name">end</property>
+            <property name="label" translatable="yes">Action</property>
+            <property name="visible">True</property>
+          </object>
+        </child>
+      </object>
+    </child>
+  </object>
+</interface>
diff --git a/testsuite/css/nodes/notebook.right.nodes b/testsuite/css/nodes/notebook.right.nodes
deleted file mode 100644 (file)
index 500331c..0000000
+++ /dev/null
@@ -1,18 +0,0 @@
-[window.background:dir(ltr)]
-  decoration:dir(ltr)
-  notebook.frame:dir(ltr)
-    stack:dir(ltr)
-      button#page1.text-button:dir(ltr)
-        label:dir(ltr)
-      button#page2.text-button:dir(ltr)
-        label:dir(ltr)
-    header.right:dir(ltr)
-      button#start.text-button:dir(ltr)
-        label:dir(ltr)
-      tabs:dir(ltr)
-        tab:active:dir(ltr)
-          label#tab1:dir(ltr)
-        tab:dir(ltr)
-          label#tab2:dir(ltr)
-      button#end.text-button:dir(ltr)
-        label:dir(ltr)
diff --git a/testsuite/css/nodes/notebook.right.rtl.nodes b/testsuite/css/nodes/notebook.right.rtl.nodes
new file mode 100644 (file)
index 0000000..fe9dd83
--- /dev/null
@@ -0,0 +1,18 @@
+[window.background:dir(rtl)]
+  decoration:dir(ltr)
+  notebook.frame:dir(rtl)
+    header.left:dir(ltr)
+      button#start.text-button:dir(rtl)
+        label:dir(ltr)
+      tabs:dir(ltr)
+        tab:active:dir(ltr)
+          label#tab1:dir(ltr)
+        tab:dir(ltr)
+          label#tab2:dir(ltr)
+      button#end.text-button:dir(rtl)
+        label:dir(ltr)
+    stack:dir(ltr)
+      button#page1.text-button:dir(rtl)
+        label:dir(ltr)
+      button#page2.text-button:dir(rtl)
+        label:dir(ltr)
diff --git a/testsuite/css/nodes/notebook.right.rtl.ui b/testsuite/css/nodes/notebook.right.rtl.ui
new file mode 100644 (file)
index 0000000..7bea7d9
--- /dev/null
@@ -0,0 +1,56 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<interface>
+  <!-- interface-requires gtk+ 3.0 -->
+  <object class="GtkWindow" id="window1">
+    <property name="can_focus">False</property>
+    <property name="type">popup</property>
+    <child>
+      <object class="GtkNotebook">
+        <property name="visible">True</property>
+        <property name="tab-pos">right</property>
+        <child>
+          <object class="GtkButton">
+            <property name="name">page1</property>
+            <property name="label" translatable="yes">Yes</property>
+            <property name="visible">True</property>
+          </object>
+        </child>
+        <child type="tab">
+          <object class="GtkLabel">
+            <property name="name">tab1</property>
+            <property name="label" translatable="yes">Tab 1</property>
+            <property name="visible">True</property>
+          </object>
+        </child>
+        <child>
+          <object class="GtkButton">
+            <property name="name">page2</property>
+            <property name="label" translatable="yes">No</property>
+            <property name="visible">True</property>
+          </object>
+        </child>
+        <child type="tab">
+          <object class="GtkLabel" id="tab2">
+            <property name="name">tab2</property>
+            <property name="label" translatable="yes">Tab 2</property>
+            <property name="visible">True</property>
+          </object>
+        </child>
+        <child type="action-start">
+          <object class="GtkButton">
+            <property name="name">start</property>
+            <property name="label" translatable="yes">Action</property>
+            <property name="visible">True</property>
+          </object>
+        </child>
+        <child type="action-end">
+          <object class="GtkButton">
+            <property name="name">end</property>
+            <property name="label" translatable="yes">Action</property>
+            <property name="visible">True</property>
+          </object>
+        </child>
+      </object>
+    </child>
+  </object>
+</interface>
diff --git a/testsuite/css/nodes/notebook.right.ui b/testsuite/css/nodes/notebook.right.ui
deleted file mode 100644 (file)
index 7bea7d9..0000000
+++ /dev/null
@@ -1,56 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<interface>
-  <!-- interface-requires gtk+ 3.0 -->
-  <object class="GtkWindow" id="window1">
-    <property name="can_focus">False</property>
-    <property name="type">popup</property>
-    <child>
-      <object class="GtkNotebook">
-        <property name="visible">True</property>
-        <property name="tab-pos">right</property>
-        <child>
-          <object class="GtkButton">
-            <property name="name">page1</property>
-            <property name="label" translatable="yes">Yes</property>
-            <property name="visible">True</property>
-          </object>
-        </child>
-        <child type="tab">
-          <object class="GtkLabel">
-            <property name="name">tab1</property>
-            <property name="label" translatable="yes">Tab 1</property>
-            <property name="visible">True</property>
-          </object>
-        </child>
-        <child>
-          <object class="GtkButton">
-            <property name="name">page2</property>
-            <property name="label" translatable="yes">No</property>
-            <property name="visible">True</property>
-          </object>
-        </child>
-        <child type="tab">
-          <object class="GtkLabel" id="tab2">
-            <property name="name">tab2</property>
-            <property name="label" translatable="yes">Tab 2</property>
-            <property name="visible">True</property>
-          </object>
-        </child>
-        <child type="action-start">
-          <object class="GtkButton">
-            <property name="name">start</property>
-            <property name="label" translatable="yes">Action</property>
-            <property name="visible">True</property>
-          </object>
-        </child>
-        <child type="action-end">
-          <object class="GtkButton">
-            <property name="name">end</property>
-            <property name="label" translatable="yes">Action</property>
-            <property name="visible">True</property>
-          </object>
-        </child>
-      </object>
-    </child>
-  </object>
-</interface>
diff --git a/testsuite/css/nodes/notebook.top.ltr.nodes b/testsuite/css/nodes/notebook.top.ltr.nodes
new file mode 100644 (file)
index 0000000..6009264
--- /dev/null
@@ -0,0 +1,18 @@
+[window.background:dir(ltr)]
+  decoration:dir(ltr)
+  notebook.frame:dir(ltr)
+    header.top:dir(ltr)
+      button#start.text-button:dir(ltr)
+        label:dir(ltr)
+      tabs:dir(ltr)
+        tab:active:dir(ltr)
+          label#tab1:dir(ltr)
+        tab:dir(ltr)
+          label#tab2:dir(ltr)
+      button#end.text-button:dir(ltr)
+        label:dir(ltr)
+    stack:dir(ltr)
+      button#page1.text-button:dir(ltr)
+        label:dir(ltr)
+      button#page2.text-button:dir(ltr)
+        label:dir(ltr)
diff --git a/testsuite/css/nodes/notebook.top.ltr.ui b/testsuite/css/nodes/notebook.top.ltr.ui
new file mode 100644 (file)
index 0000000..a080a52
--- /dev/null
@@ -0,0 +1,55 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<interface>
+  <!-- interface-requires gtk+ 3.0 -->
+  <object class="GtkWindow" id="window1">
+    <property name="can_focus">False</property>
+    <property name="type">popup</property>
+    <child>
+      <object class="GtkNotebook">
+        <property name="visible">True</property>
+        <child>
+          <object class="GtkButton">
+            <property name="name">page1</property>
+            <property name="label" translatable="yes">Yes</property>
+            <property name="visible">True</property>
+          </object>
+        </child>
+        <child type="tab">
+          <object class="GtkLabel">
+            <property name="name">tab1</property>
+            <property name="label" translatable="yes">Tab 1</property>
+            <property name="visible">True</property>
+          </object>
+        </child>
+        <child>
+          <object class="GtkButton">
+            <property name="name">page2</property>
+            <property name="label" translatable="yes">No</property>
+            <property name="visible">True</property>
+          </object>
+        </child>
+        <child type="tab">
+          <object class="GtkLabel" id="tab2">
+            <property name="name">tab2</property>
+            <property name="label" translatable="yes">Tab 2</property>
+            <property name="visible">True</property>
+          </object>
+        </child>
+        <child type="action-start">
+          <object class="GtkButton">
+            <property name="name">start</property>
+            <property name="label" translatable="yes">Action</property>
+            <property name="visible">True</property>
+          </object>
+        </child>
+        <child type="action-end">
+          <object class="GtkButton">
+            <property name="name">end</property>
+            <property name="label" translatable="yes">Action</property>
+            <property name="visible">True</property>
+          </object>
+        </child>
+      </object>
+    </child>
+  </object>
+</interface>
diff --git a/testsuite/css/nodes/notebook.top.nodes b/testsuite/css/nodes/notebook.top.nodes
deleted file mode 100644 (file)
index 6009264..0000000
+++ /dev/null
@@ -1,18 +0,0 @@
-[window.background:dir(ltr)]
-  decoration:dir(ltr)
-  notebook.frame:dir(ltr)
-    header.top:dir(ltr)
-      button#start.text-button:dir(ltr)
-        label:dir(ltr)
-      tabs:dir(ltr)
-        tab:active:dir(ltr)
-          label#tab1:dir(ltr)
-        tab:dir(ltr)
-          label#tab2:dir(ltr)
-      button#end.text-button:dir(ltr)
-        label:dir(ltr)
-    stack:dir(ltr)
-      button#page1.text-button:dir(ltr)
-        label:dir(ltr)
-      button#page2.text-button:dir(ltr)
-        label:dir(ltr)
diff --git a/testsuite/css/nodes/notebook.top.rtl.nodes b/testsuite/css/nodes/notebook.top.rtl.nodes
new file mode 100644 (file)
index 0000000..4d46049
--- /dev/null
@@ -0,0 +1,18 @@
+[window.background:dir(rtl)]
+  decoration:dir(ltr)
+  notebook.frame:dir(rtl)
+    header.top:dir(ltr)
+      button#end.text-button:dir(rtl)
+        label:dir(ltr)
+      tabs:dir(ltr)
+        tab:dir(ltr)
+          label#tab2:dir(ltr)
+        tab:active:dir(ltr)
+          label#tab1:dir(ltr)
+      button#start.text-button:dir(rtl)
+        label:dir(ltr)
+    stack:dir(ltr)
+      button#page1.text-button:dir(rtl)
+        label:dir(ltr)
+      button#page2.text-button:dir(rtl)
+        label:dir(ltr)
diff --git a/testsuite/css/nodes/notebook.top.rtl.ui b/testsuite/css/nodes/notebook.top.rtl.ui
new file mode 100644 (file)
index 0000000..a080a52
--- /dev/null
@@ -0,0 +1,55 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<interface>
+  <!-- interface-requires gtk+ 3.0 -->
+  <object class="GtkWindow" id="window1">
+    <property name="can_focus">False</property>
+    <property name="type">popup</property>
+    <child>
+      <object class="GtkNotebook">
+        <property name="visible">True</property>
+        <child>
+          <object class="GtkButton">
+            <property name="name">page1</property>
+            <property name="label" translatable="yes">Yes</property>
+            <property name="visible">True</property>
+          </object>
+        </child>
+        <child type="tab">
+          <object class="GtkLabel">
+            <property name="name">tab1</property>
+            <property name="label" translatable="yes">Tab 1</property>
+            <property name="visible">True</property>
+          </object>
+        </child>
+        <child>
+          <object class="GtkButton">
+            <property name="name">page2</property>
+            <property name="label" translatable="yes">No</property>
+            <property name="visible">True</property>
+          </object>
+        </child>
+        <child type="tab">
+          <object class="GtkLabel" id="tab2">
+            <property name="name">tab2</property>
+            <property name="label" translatable="yes">Tab 2</property>
+            <property name="visible">True</property>
+          </object>
+        </child>
+        <child type="action-start">
+          <object class="GtkButton">
+            <property name="name">start</property>
+            <property name="label" translatable="yes">Action</property>
+            <property name="visible">True</property>
+          </object>
+        </child>
+        <child type="action-end">
+          <object class="GtkButton">
+            <property name="name">end</property>
+            <property name="label" translatable="yes">Action</property>
+            <property name="visible">True</property>
+          </object>
+        </child>
+      </object>
+    </child>
+  </object>
+</interface>
diff --git a/testsuite/css/nodes/notebook.top.ui b/testsuite/css/nodes/notebook.top.ui
deleted file mode 100644 (file)
index a080a52..0000000
+++ /dev/null
@@ -1,55 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<interface>
-  <!-- interface-requires gtk+ 3.0 -->
-  <object class="GtkWindow" id="window1">
-    <property name="can_focus">False</property>
-    <property name="type">popup</property>
-    <child>
-      <object class="GtkNotebook">
-        <property name="visible">True</property>
-        <child>
-          <object class="GtkButton">
-            <property name="name">page1</property>
-            <property name="label" translatable="yes">Yes</property>
-            <property name="visible">True</property>
-          </object>
-        </child>
-        <child type="tab">
-          <object class="GtkLabel">
-            <property name="name">tab1</property>
-            <property name="label" translatable="yes">Tab 1</property>
-            <property name="visible">True</property>
-          </object>
-        </child>
-        <child>
-          <object class="GtkButton">
-            <property name="name">page2</property>
-            <property name="label" translatable="yes">No</property>
-            <property name="visible">True</property>
-          </object>
-        </child>
-        <child type="tab">
-          <object class="GtkLabel" id="tab2">
-            <property name="name">tab2</property>
-            <property name="label" translatable="yes">Tab 2</property>
-            <property name="visible">True</property>
-          </object>
-        </child>
-        <child type="action-start">
-          <object class="GtkButton">
-            <property name="name">start</property>
-            <property name="label" translatable="yes">Action</property>
-            <property name="visible">True</property>
-          </object>
-        </child>
-        <child type="action-end">
-          <object class="GtkButton">
-            <property name="name">end</property>
-            <property name="label" translatable="yes">Action</property>
-            <property name="visible">True</property>
-          </object>
-        </child>
-      </object>
-    </child>
-  </object>
-</interface>